import React, { Component } from 'react'

export default function (Comp) {
  return class Far extends Component {
    state = {
      username: '',
      password: '',
      repassword: '',
    }
    handle = (name) => (e) => {
      this.setState({
        [name]: e.target.value.trim(),
      })
    }
    render() {
      return <Comp {...this.state} handle={this.handle}></Comp>
    }
  }
}
